package com.hzit.user.api.factory;

import com.hzit.user.RemoteUserService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Component
public class RemoteUserFallback implements FallbackFactory<RemoteUserService> {
	@Override
	public RemoteUserService create(Throwable cause) {
		return new RemoteUserService() {
			@Override
			public AjaxResult saveUser() {
				return AjaxResult.error(500,cause.getMessage());
			}

			@Override
			public AjaxResult findAll() {
				return AjaxResult.error(500,cause.getMessage());
			}
		};
	}
}
